package com.gonsin.gview.model.tab;

import com.gonsin.gview.model.GBoardModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel("标签区域")
public class GTabModels extends GBoardModel {

    @ApiModelProperty("页面类型")
    private String boardType = "tab";
//    {
//        setBoardType("tab");
//    }

    @ApiModelProperty("每一个标签栏")
    private List<GTabModel> tabs;

    @Override
    public GBoardModel tClone() {
        GTabModels model = new GTabModels();
        model.setBoardType("tab");
//        BeanUtil.copyProperties(this, model, CopyOptions.create().setIgnoreNullValue(true));
        if(tabs != null){
            model.tabs = new ArrayList<>();
            for(GTabModel t : tabs){
                model.tabs.add(t.tClone());
            }
        }
        return model;
    }

}
